package com.eorchis.module.usermessagemanage.ui.commond;

import java.util.Date;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.apache.commons.beanutils.BeanUtils;
import org.codehaus.jackson.map.ObjectMapper;

import com.eorchis.core.page.commond.SortInfoBean;
import com.eorchis.core.ui.commond.IQueryCommond;
import com.eorchis.core.ui.commond.impl.BasePageQueryCommond;

public class UserMessageManageQueryCommond extends BasePageQueryCommond implements IQueryCommond {
	
	
	private String depId;
	private String treepath;
	private String searchLoginId;//学员账号
	private String searchUserName;//用户姓名
	private String searchrankCode;//职级
	private String searchDuty;//职务
	private String searchStatusCode;//身份
	private String[] searchStatusCodes;//身份集合
	private Integer searchSiGuan;//是否为市管 1市管
	private Integer searchUsertId;//用户id
	
	private String paperNum;//身份账号
	private Date heldofficeDate;
	private String heldofficeDateStr;
	private Integer userID;
	private Integer loginId;
	private String[] userIds;
	private List<Integer> userId;
	
	public List<Integer> getUserId() {
		return userId;
	}
	public void setUserId(List<Integer> userId) {
		this.userId = userId;
	}
	public String[] getUserIds() {
		return userIds;
	}
	public void setUserIds(String[] userIds) {
		this.userIds = userIds;
	}
	public String getHeldofficeDateStr() {
		return heldofficeDateStr;
	}
	public void setHeldofficeDateStr(String heldofficeDateStr) {
		this.heldofficeDateStr = heldofficeDateStr;
	}
	public String getDepId() {
		return depId;
	}
	public void setDepId(String depId) {
		this.depId = depId;
	}
	
	public String getTreepath() {
		return treepath;
	}
	public void setTreepath(String treepath) {
		this.treepath = treepath;
	}
	public String getSearchLoginId() {
		return searchLoginId;
	}
	public void setSearchLoginId(String searchLoginId) {
		this.searchLoginId = searchLoginId;
	}
	public String getSearchUserName() {
		return searchUserName;
	}
	public void setSearchUserName(String searchUserName) {
		this.searchUserName = searchUserName;
	}
	public String getSearchrankCode() {
		return searchrankCode;
	}
	public void setSearchrankCode(String searchrankCode) {
		this.searchrankCode = searchrankCode;
	}
	public String getSearchDuty() {
		return searchDuty;
	}
	public void setSearchDuty(String searchDuty) {
		this.searchDuty = searchDuty;
	}
	
	public String getSearchStatusCode() {
		return searchStatusCode;
	}
	public void setSearchStatusCode(String searchStatusCode) {
		this.searchStatusCode = searchStatusCode;
	}
	public String[] getSearchStatusCodes() {
		return searchStatusCodes;
	}
	public void setSearchStatusCodes(String[] searchStatusCodes) {
		this.searchStatusCodes = searchStatusCodes;
	}
	public Integer getSearchSiGuan() {
		return searchSiGuan;
	}
	public void setSearchSiGuan(Integer searchSiGuan) {
		this.searchSiGuan = searchSiGuan;
	}
	

	
	public Integer getSearchUsertId() {
		return searchUsertId;
	}
	public void setSearchUsertId(Integer searchUsertId) {
		this.searchUsertId = searchUsertId;
	}





	public String getPaperNum() {
		return paperNum;
	}
	public void setPaperNum(String paperNum) {
		this.paperNum = paperNum;
	}
	public Date getHeldofficeDate() {
		return heldofficeDate;
	}
	public void setHeldofficeDate(Date heldofficeDate) {
		this.heldofficeDate = heldofficeDate;
	}
	public Integer getUserID() {
		return userID;
	}
	public void setUserID(Integer userID) {
		this.userID = userID;
	}
	public Integer getLoginId() {
		return loginId;
	}
	public void setLoginId(Integer loginId) {
		this.loginId = loginId;
	}





	/**
	 * EXT 页面排序
	 */
	private SortInfoBean sortInfo = null;
	/**
	 * 获取排序内容
	 * 
	 * @return
	 * @author HuangS
	 * @date Jul 20, 2012
	 */
	@SuppressWarnings("unchecked")
	public SortInfoBean getSortInfos() {
		return this.sortInfo;
	}
	/**
	 * 设置排序内容
	 * 
	 * @param sort
	 * @author HuangS
	 * @date Jul 25, 2012
	 */
	@SuppressWarnings("unchecked")
	public void setSort(String sort) {
		if (sort != null && !"".equals(sort)) {
			sortInfo = new SortInfoBean();
			ObjectMapper objectMapper = new ObjectMapper();
			try {
				List<LinkedHashMap<String, Object>> list = objectMapper.readValue(sort, List.class);
				for (int i = 0; i < list.size(); i++) {
					Map<String, Object> map = list.get(i);
					Set<String> set = map.keySet();
					for (Iterator<String> it = set.iterator(); it.hasNext();) {
						String key = it.next();
						BeanUtils.setProperty(sortInfo, key, map.get(key));
					}
				}
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
	
	
	
	
	
	
}
